<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/default.css">
        <link rel="stylesheet" type="text/css" href="css/menu.css">
        <link rel="stylesheet" type="text/css" href="css/newCli.css">
        <title></title>
    </head>

    <body>
        <div id="container">
            
            

            <div id="title">
                <div id="img">
                <img src="css/ico_car.png"/>
                </div>
                <div id="h1">
                <h1>Park Control</h1>
                </div>
            </div>
            <div id="menu">
                <ul class="menu">
                    <li><a href="#" title="Cadastros">Cadastros</a>
                        <ul>
                            <li><a href="newCli.php" target="_parent" >Cadastrar Clientes</a></li>
                            <li><a href="newCar.php" target="_parent">Cadastrar Carros</a></li>
                            <li><a href="newFares.php" target="_parent">Cadastrar Tarifas</a></li>
                        </ul>
                    </li>
                    <li><a href="#" title="Gerenciar">Gerenciar</a>
                        <ul>
                            <li><a href="newPark.php" target="_parent">Entrada de Carros</a></li>
                            <li><a href="relExitPark.php" target="_parent">Saida de Carros</a></li>
                        </ul>
                    </li>
                    <li><a href="#" title="Relatorios">Relatorios</a>
                        <ul>
                            <li><a href="relCar.php" target="_parent">Relatório de Carros</a></li>
                            <li><a href="relCli.php" target="_parent">Relatório de Clientes</a></li>
                            <li><a href="relPark.php" target="_parent">Relatório de Entradas</a></li>    
                        </ul>
                    </li>
                </ul>
            </div>
            <form method="POST" action="action/InsertCustomers.action.php" name="newCliForm" id="newCliForm"/> 

            <div id="clidata">
                <div id="span"> 
                    <span id="newCliError" class="error"><h2>Cadastrar Novo Cliente</h2></span>
                </div>
                
                <fieldset>
                    <?php include 'action/EditClients.action.php' ?>
                    <label id="cliNameLabel">
                        Nome:
                        <input type="hidden" id="idCli" name="idCli" value="<?php echo $cli->getId(); ?>"/>
                        <input type="text" id="cliNameInput" name="cliNameInput" size=30 maxlength=30 value="<?php echo $cli->getName(); ?>" onChange="javascript:this.value=this.value.toUpperCase();"/>
                    </label>

                    <label id="cliPhoneLabel">
                        Telefone:
                        <input type="text" id="cliPhoneInput" name="cliPhoneInput" size=11 maxlength=11 pattern="\([0-9]{2}\)[0-9]{4}-[0-9]{4}"value="<?php echo $cli->getPhone(); ?>" onChange="javascript:this.value=this.value.toUpperCase();"/>
                    </label>

                    <label id="cliDateLabel">
                        Data de Nasc.:
                        <input type=date id="cliDateInput" name="cliDateInput" size=10 maxlength=10 value="<?php echo $cli->getBirth() ?>" onChange="javascript:this.value=this.value.toUpperCase();"/>
                    </label>

                    <label id="cliDocLabel">
                        CPF:
                        <input type="text" id="cliDocInput" name="cliDocInput" size=11 maxlength=11 value="<?php echo $cli->getDoc() ?>" onChange="javascript:this.value=this.value.toUpperCase();"/>
                    </label>

                    <label id="cliSexLabel">
                        Sexo:
                        <select name="cliGenreSelect" id="cliGenreSelect" value="<?php echo $cli->getSex() ?>" onChange="javascript:this.value=this.value.toUpperCase();">

                            <option value="<?php echo $cli->getSex() ?>"></option>
                            <option  value="M">Masculino</option>
                            <option  value="F">Feminino</option>
                        </select>
                    </label>
                </fieldset>
            </div>

            <div id="addressdata">
                <fieldset>
                    <div id="esq">
                        <label id="cliStreetLabel">
                            Rua:
                            <input type="hidden" id="addresIdInput" name="addresIdInput" value="" />
                            <input type="text" id="cliStreetInput" name="cliStreetInput" value="<?php echo $ad->getStreet()?>" size=40 maxlength=40 onChange="javascript:this.value=this.value.toUpperCase();"/>
                        </label>

                        <label id="cliNumbLabel">
                            Numero:
                            <input type="text" id="cliNumbInput" name="cliNumbInput"  value=" <?php echo $ad->getNumber()?>" size=6 maxlength=6 onChange="javascript:this.value=this.value.toUpperCase();"/>
                        </label>

                        <label id="cliNeigLabel">
                            Bairro:
                            <input type="text" id="cliNeigInput" name="cliNeigInput" value="<?php echo $ad->getNeigh()?>" size=15 maxlength=15 onChange="javascript:this.value=this.value.toUpperCase();"/>
                        </label>

                        <label id="cliZipLabel">
                            CEP:
                            <input type="text" id="cliZipInput" name="cliZipInput" size=9 maxlength=9 value="<?php echo $ad->getZipcod()?>" onChange="javascript:this.value=this.value.toUpperCase();" >
                        </label>

                        <label id="cliCityLabel">
                            Cidade:
                            <input type="text" id="cliCityInput" name="cliCityInput" size=20 maxlength=20  value="<?php echo $ad->getCity()?>" onChange="javascript:this.value=this.value.toUpperCase();"/>
                        </label>

                        <label id="cliStateLabel">
                            Estado:
                            <input type="text" id="cliStateInput" name="cliStateInput" size=2 maxlength=2 value="<?php echo $ad->getState()?>" onChange="javascript:this.value=this.value.toUpperCase();">
                        </label>
                    </div>

                    <div id="googlediv">
                        <span id="google" class="google"></span>
                    </div>
                </fieldset>
            </div>


            <div id="buttons">
                <input type="button" id="cliOkButton" value = "Cadastrar" />
                <input type="reset" id="cliResetButton" value = "Limpar" />
                <input type="button" id="cliMapButton" value = "Ver Mapa" />
            </div>

        </form>
    </div>
    <script type="text/javascript" src="js/mask.js"></script>
    <script type="text/javascript" src="js/libs/MaskedInput/MaskedInput.js"></script>
    <script type="text/javascript" src="js/validation.js"></script>
    <script type="text/javascript" src="js/newCli.js"></script>
</body>
</html>